Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scripts): codegen cleanup #517

Merged
merged 1 commit into from
May 19, 2022
Merged

fix(scripts): codegen cleanup #517

merged 1 commit into from
May 19, 2022

Conversation

shortcuts
Copy link
Member

🧭 What and Why

🎟 JIRA Ticket: -

Changes included:

Follow up of #513

It seems that the cleanup job is ran on main (https://github.com/algolia/api-clients-automation/runs/6507516796?check_suite_focus=true), so the comment ends up being wrong: #513 (comment)

We now provide the current branch name directly from HEAD_BRANCH, so we can fallback to it if we are on main

🧪 Test

CI :D

@shortcuts shortcuts requested a review from millotp May 19, 2022 13:39
@shortcuts shortcuts self-assigned this May 19, 2022
@netlify
Copy link

netlify bot commented May 19, 2022

Deploy Preview for api-clients-automation canceled.

Name Link
🔨 Latest commit 7e5953d
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/6286489a224f360008713bc2

@algolia-bot
Copy link
Collaborator

algolia-bot commented May 19, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the main branch.
You can still access the code generated on main via this commit.

Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smooth !

Comment on lines +69 to +71
jest.spyOn(common, 'run').mockImplementation(() => {
return Promise.resolve(mockedResolvedValue);
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
jest.spyOn(common, 'run').mockImplementation(() => {
return Promise.resolve(mockedResolvedValue);
});
jest.spyOn(common, 'run').mockResolvedValue(mockedResolvedValue);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk why I did not managed to make it work at first so went with the non sugar implem

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes it's because the mockedResolvedValue variable changes and need to be reevaluated everytime, while mockResolvedValue function only evaluate at the start.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes make sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants